package com.baselibrary.libs.example.example_listView.View;

import android.content.Context;
import android.view.View;

import com.baselibrary.libs.base.baseAdapter.BaseListViewAdapter;
import com.baselibrary.libs.base.baseAdapter.MyViewHolder;
import com.baselibrary.libs.example.example_listView.bean.itemData;
import com.baselibrary.libs.example.example_listView.interfaces.listViewCallBack;
import com.baselibrary.libs.R;
import java.util.List;


/**
 * Created by 35876 于萌萌
 * 创建日期: 16:00 . 2016年10月08日
 * 描述:
 * <p>
 * <p>
 * 备注:
 */ //我的行程adapter
public class ListView_example extends BaseListViewAdapter<itemData> {
    int type;
    listViewCallBack callBack;
    //重要的判断这个列表的性质 有再分期 还是没有再分期
    public ListView_example(Context context, int type, List datas, listViewCallBack callBack) {
        super(context, type, datas);
        this.type = type;
        this.callBack = callBack;
    }




    @Override
    public int getCount() {
        return mDatas.size();
    }

    @Override
    public int getViewType(itemData itemData, int position) {
        return R.layout.listview_item;
    }

    @Override
    public void convert(MyViewHolder helper, itemData item, final int position) {
        helper.initText(R.id.list_item_tv,item.name);
        helper.initRelativeLayout(R.id.list_item_rl)
                .setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                callBack.CallBackCilckItem(position);
            }
        });

    }



    public int getType() {
        return type;
    }





}
